<template>
  <div class="ke-intro">
    <div class="poster">
      <img :src="poster" />
    </div>
    <div class="courseName">{{courseName}}</div>
    <div class="teacher">{{teacherName}}</div>
    <div class="price">
      <div class="money">{{price}}</div>
      <div class="buyNum">{{buyNumber}}人购买</div>
    </div>
  </div>
</template>

<script>
export default {
  name: 'ke-intro',
  props: {
    poster: {
      type: String,
      default: require('../../assets/images/login-banner.jpg')
    },
    courseName: {
      type: String,
      default: 'vue源码解读'
    },
    price: {
      type: String,
      default: '免费'
    },
    buyNumber: {
      type: Number,
      default: 0
    },
    teacherName: {
      type: String,
      default: '夜殇老师'
    }
  }
}
</script>

<style lang="stylus" scoped>
.ke-intro {
  position: relative;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  padding: 7px 7px 10px 7px;
  overflow: hidden;

  .poster {
    width: 220px;
    height: 124px;

    img {
      width: 100%;
      height: 100%;
    }
  }

  .courseName {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    height: 25px;
    line-height: 20px;
    font-size: 14px;
    padding-top: 5px;
    margin-top: 10px;
    box-sizing: border-box;
  }

  .teacher {
    height: 18px;
    font-size: 12px;
    line-height: 18px;
    margin-bottom: 3px;
    color: rgb(51, 51, 51);
  }

  .price {
    overflow: hidden;
    display: flex;
    flex-direction: row;
    height: 24px;
    justify-content: space-between;

    .money {
      color: #f4621f;
      font-size: 14px;
    }

    .buyNum {
      color: #999999;
      font-size: 12px;
    }
  }
}
</style>
